<template>
  <div>
    Login
    <button @click="handleLogin">登录</button>
  </div>
</template>

<script>
export default {
  methods: {
    handleLogin () {
      setTimeout(() => {
        localStorage.setItem('token','后端传入')
        // console.log(this.$route);

        // this.$router.back() //返回

        // 跳转到本来要去却被拦截的地址
        this.$router.push(this.$route.query.redirect)
      },1)
    }
  }
}
</script>
